// Decompiled by DJ v3.9.9.91 Copyright 2005 Atanas Neshkov  Date: 2008-7-11 22:38:43
// Home Page : http://members.fortunecity.com/neshkov/dj.html  - Check often for new version!
// Decompiler options: packimports(3) 
// Source File Name:   ConfigXML.java

package com.creawor.imei.config;

import java.util.ArrayList;
import java.util.HashMap;
import java.util.List;

import org.apache.commons.digester.Digester;
import org.apache.log4j.Category;

// Referenced classes of package com.creawor.imei.config:
//            SystemParameterBean

public final class ConfigXML
{

    public ConfigXML()
    {
        cat = Category.getInstance(org.apache.log4j.Category.class.getName());
        pathname = null;
        ht = new HashMap();
        list = new ArrayList();
    }

    public String getPathname()
    {
        return pathname;
    }

    public void setPathname(String pathname)
    {
        this.pathname = pathname;
    }

    public void open()
        throws Exception
    {
        try
        {
            Digester digester = new Digester();
            digester.push(this);
            digester.setValidating(false);
            digester.addCallMethod("imei/parameter", "addeoffice", 2);
            digester.addCallParam("imei/parameter/parameter_name", 0);
            digester.addCallParam("imei/parameter/parameter_value", 1);
            digester.parse(pathname);
        }
        catch(Exception e)
        {
            cat.error((new StringBuilder(" error of digester config xml file ")).append(e.getMessage()).toString());
        }
    }

    public void addeoffice(String parameter_name, String parameter_value)
    {
        cat.info((new StringBuilder("Parameter: ")).append(parameter_name).append("=").append(parameter_value).toString());
        ht.put(parameter_name, parameter_value);
        SystemParameterBean spb = new SystemParameterBean();
        spb.setParameter_name(parameter_name);
        spb.setParameter_value(parameter_value);
        list.add(spb);
    }

    public HashMap getHashMap()
    {
        return ht;
    }

    public List getList()
    {
        return list;
    }

    private Category cat;
    private String pathname;
    HashMap ht;
    List list;
    static Class class$0;
}